package org.ricks.boot;

/**
 * @author ricks
 * @Description: ShutdownHook 驱动stop
 * ServerBootstrap中驱动模块stop
 * @date 2023/1/1113:59
 */
public class ShutdownHook extends Thread{

    private final ServerBootstrap serverBootstrap;

    public ShutdownHook(ServerBootstrap serverBootstrap) {
        // 修正停服逻辑线程名称
        super("shutdown");
        this.serverBootstrap = serverBootstrap;
    }

    @Override
    public void run() {
        this.serverBootstrap.stop();
    }
}
